var express = require('express');
var router = express.Router();
var utils = require('../functions/utils');

router.post('/', function(req,res)
{
/*
	Input parameters 

	 *  	sessionId			edit user session
*/
	var sessionId = req.body.sessionId;			utils.checkParamValue( 'sessionId' , sessionId);

	//utils.callLog(req);

	utils.sessionTraceLog(req);


	var async = require('async');
	async.waterfall([
		function(cb)
		{
			utils.getUserIdWithSessionId(sessionId , cb);
		}
		,function(userId , cb) {
			if(!userId)
			{
				var err = new Error('Invalid session ID : ' + sessionId);
				err.code = '522';
				throw err;
			}

			var ret = {code : 200};	 // 기본값은 성공

			res.json(ret);
			res.end();

		}
	]); //waterfall


}); // router

module.exports = router;